package com.miracle.controller;

import com.miracle.clients.ProductClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


import java.util.Map;

/**
 * @author jie.xi
 * @date 2022年04月27日 17:41
 */

@RestController
@Slf4j
public class UserFeignController {

   @Autowired
    ProductClient productClient;

    @GetMapping("/user/getProductInfo1")
    public Map<String, Object> getProductInfo1(@RequestParam("id") String productId){
        Map<String, Object> stringObjectMap = productClient.find(productId);
        log.info("返回的信息：[{}]",stringObjectMap);
        return stringObjectMap;
    }
}
